﻿using System;
using System.Collections.Generic;

namespace AppMain
{
    public class TMLieUpProcesser : BaseMoveProcesser
    {
        float lieUpTime = 0.2f;//起身无敌
        float add = 0;
        protected override void onEnter(RoleMove_Status fromStatus)
        {
            this.agent.Lock((int)Lock_Status.MoveLock);
            this.agent.AttrMap.getAttr<int>(RoleAttr.InvincibleCount).Value++;
            add = 0;
        }

        protected override void onUpdate()
        {
            add = 0;
        }

        protected override void onExit(RoleMove_Status toStatus)
        {
            this.agent.AttrMap.getAttr<int>(RoleAttr.InvincibleCount).Value--;
        }

        protected override void onTick(float frameTime)
        {
            add += frameTime;
            if (add >= lieUpTime)
            {
                //box3D
                this.agent.box3D.Transverse = false;
                this.agent.move(0, 0);
                this.agent.moveWidget.forceTo(RoleMove_Status.Stand);
            }
        }

        protected override void onDispose()
        {

        }
    }
}
